<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="kq139596">gpconfig</title>
  <body>
    <p>Sets server configuration parameters on all segments within a Greenplum Database system.</p>
    <section id="section2">
      <title>Synopsis</title>
      <codeblock>gpconfig -c &lt;param_name> -v &lt;value> [-m &lt;master_value> | --masteronly]
       | -r &lt;param_name> [--masteronly]
       | -l
       [--skipvalidation] [--verbose] [--debug]

gpconfig -s &lt;param_name> [--file | --file-compare] [--verbose] [--debug]

gpconfig --help</codeblock>
    </section>
    <section id="section3">
      <title>Description</title>
      <p>The <codeph>gpconfig</codeph> utility allows you to set, unset, or view configuration
        parameters from the <codeph>postgresql.conf</codeph> files of all instances (master,
        segments, and mirrors) in your Greenplum Database system. When setting a parameter, you can
        also specify a different value for the master if necessary. For example, parameters such as
          <codeph>max_connections</codeph> require a different setting on the master than what is
        used for the segments. If you want to set or unset a global or master only parameter, use
        the <codeph>--masteronly</codeph> option.</p>
      <note>For configuration parameters of vartype <codeph>string</codeph>, you may not pass values
        enclosed in single quotes to <codeph>gpconfig -c</codeph>.</note>
      <p><codeph>gpconfig</codeph> can only be used to manage certain parameters. For example, you
        cannot use it to set parameters such as <codeph>port</codeph>, which is required to be
        distinct for every segment instance. Use the <codeph>-l</codeph> (list) option to see a
        complete list of configuration parameters supported by <codeph>gpconfig</codeph>.</p>
      <p>When <codeph>gpconfig</codeph> sets a configuration parameter in a segment
          <codeph>postgresql.conf</codeph> file, the new parameter setting always displays at the
        bottom of the file. When you use <codeph>gpconfig</codeph> to remove a configuration
        parameter setting, <codeph>gpconfig</codeph> comments out the parameter in all segment
          <codeph>postgresql.conf</codeph> files, thereby restoring the system default setting. For
        example, if you use <codeph>gpconfig </codeph>to remove (comment out) a parameter and later
        add it back (set a new value), there will be two instances of the parameter; one that is
        commented out, and one that is enabled and inserted at the bottom of the
          <codeph>postgresql.conf</codeph> file.</p>
      <p>After setting a parameter, you must restart your Greenplum Database system or reload the
          <codeph>postgresql.conf</codeph> files in order for the change to take effect. Whether you
        require a restart or a reload depends on the parameter. </p>
      <p>For more information about the server configuration parameters, see the <i>Greenplum
          Database Reference Guide</i>.</p>
      <p>To show the currently set values for a parameter across the system, use the
          <codeph>-s</codeph> option.</p>
      <p><codeph>gpconfig</codeph> uses the following environment variables to connect to the
        Greenplum Database master instance and obtain system configuration information: </p>
      <ul>
        <li id="kq141888">
          <codeph>PGHOST</codeph>
        </li>
        <li id="kq141742">
          <codeph>PGPORT</codeph>
        </li>
        <li id="kq141743">
          <codeph>PGUSER</codeph>
        </li>
        <li id="kq141744">
          <codeph>PGPASSWORD</codeph>
        </li>
        <li id="kq141745">
          <codeph>PGDATABASE</codeph>
        </li>
      </ul>
    </section>
    <section id="section4">
      <title>Options</title>
      <parml>
        <plentry>
          <pt>-c | --change <varname>param_name</varname></pt>
          <pd>Changes a configuration parameter setting by adding the new setting to the bottom of
            the <codeph>postgresql.conf</codeph> files.</pd>
        </plentry>
        <plentry>
          <pt>-v | --value <varname>value</varname></pt>
          <pd>The value to use for the configuration parameter you specified with the
              <codeph>-c</codeph> option. By default, this value is applied to all segments, their
            mirrors, the master, and the standby master.</pd>
          <pd>The utility correctly quotes the value when adding the setting to the
              <codeph>postgresql.conf</codeph> files.</pd>
          <pd>To set the value to an empty string, enter empty single quotes (<codeph>''</codeph>). </pd>
        </plentry>
        <plentry>
          <pt>-m | --mastervalue <varname>master_value</varname></pt>
          <pd>The master value to use for the configuration parameter you specified with the
              <codeph>-c</codeph> option. If specified, this value only applies to the master and
            standby master. This option can only be used with <codeph>-v</codeph>. </pd>
        </plentry>
        <plentry>
          <pt>--masteronly</pt>
          <pd>When specified, <codeph>gpconfig</codeph> will only edit the master
              <codeph>postgresql.conf</codeph> file.</pd>
        </plentry>
        <plentry>
          <pt>-r | --remove <varname>param_name</varname></pt>
          <pd>Removes a configuration parameter setting by commenting out the entry in the
              <codeph>postgresql.conf</codeph> files.</pd>
        </plentry>
        <plentry>
          <pt>-l | --list</pt>
          <pd>Lists all configuration parameters supported by the <codeph>gpconfig</codeph>
            utility.</pd>
        </plentry>
        <plentry>
          <pt>-s | --show <varname>param_name</varname></pt>
          <pd>Shows the value for a configuration parameter used on all instances (master and
            segments) in the Greenplum Database system. If there is a difference in a parameter
            value among the instances, the utility displays an error message. Running
              <codeph>gpconfig</codeph> with the <codeph>-s</codeph> option reads parameter values
            directly from the database, and not the <codeph>postgresql.conf</codeph> file. If you
            are using <codeph>gpconfig</codeph> to set configuration parameters across all segments,
            then running <codeph>gpconfig -s</codeph> to verify the changes, you might still see the
            previous (old) values. You must reload the configuration files (<codeph>gpstop
              -u</codeph>) or restart the system (<codeph>gpstop -r</codeph>) for changes to take
            effect.</pd>
        </plentry>
        <plentry>
          <pt>--file</pt>
          <pd>For a configuration parameter, shows the value from the
              <codeph>postgresql.conf</codeph> file on all instances (master and segments) in the
            Greenplum Database system. If there is a difference in a parameter value among the
            instances, the utility displays a message. Must be specified with the
              <codeph>-s</codeph> option.</pd>
          <pd>For example, the configuration parameter <codeph>statement_mem</codeph> is set to 64MB
            for a user with the <codeph>ALTER ROLE</codeph> command, and the value in the
              <codeph>postgresql.conf</codeph> file is 128MB. Running the command <codeph>gpconfig
              -s statement_mem --file</codeph> displays 128MB. The command <codeph>gpconfig -s
              statement_mem</codeph> run by the user displays 64MB. </pd>
          <pd>Not valid with the <codeph>--file-compare</codeph> option.</pd>
        </plentry>
        <plentry>
          <pt>--file-compare</pt>
          <pd>For a configuration parameter, compares the current Greenplum Database value with the
            value in the <codeph>postgresql.conf</codeph> files on hosts (master and segments). The
            values in the <codeph>postgresql.conf files</codeph> represent the value when Greenplum
            Database is restarted. </pd>
          <pd>If the values are not the same, the utility displays the values from all hosts. If all
            hosts have the same value, the utility displays a summary report.</pd>
          <pd>Not valid with the <codeph>--file</codeph> option.</pd>
        </plentry>
        <plentry>
          <pt>--skipvalidation</pt>
          <pd>Overrides the system validation checks of <codeph>gpconfig</codeph> and allows you to
            operate on any server configuration parameter, including hidden parameters and
            restricted parameters that cannot be changed by <codeph>gpconfig</codeph>. When used
            with the <codeph>-l</codeph> option (list), it shows the list of restricted parameters.
              <note type="warning">Use extreme caution when setting configuration parameters with
              this option. </note></pd>
        </plentry>
        <plentry>
          <pt>--verbose </pt>
          <pd>Displays additional log information during <codeph>gpconfig</codeph> command
            execution.</pd>
        </plentry>
        <plentry>
          <pt>--debug</pt>
          <pd>Sets logging output to debug level. </pd>
        </plentry>
        <plentry>
          <pt>-? | -h | --help</pt>
          <pd>Displays the online help.</pd>
        </plentry>
      </parml>
    </section>
    <section id="section5">
      <title>Examples</title>
      <p>Set the <codeph>max_connections</codeph> setting to 100 on all segments and 10 on the
        master:</p>
      <codeblock>gpconfig -c max_connections -v 100 -m 10</codeblock>
      <p>These examples shows the syntax required due to bash shell string processing.</p>
      <codeblock>gpconfig -c search_path -v '"\$user",public'
gpconfig -c dynamic_library_path -v '\$libdir'</codeblock>
      <p>The configuration parameters are added to the <codeph>postgresql.conf</codeph> file.</p>
      <codeblock>search_path='"$user",public'
dynamic_library_path='$libdir'</codeblock>
      <p>Comment out all instances of the <codeph>default_statistics_target</codeph> configuration
        parameter, and restore the system default:</p>
      <codeblock>gpconfig -r default_statistics_target</codeblock>
      <p>List all configuration parameters supported by <codeph>gpconfig</codeph>:</p>
      <codeblock>gpconfig -l</codeblock>
      <p>Show the values of a particular configuration parameter across the system:</p>
      <codeblock>gpconfig -s max_connections</codeblock>
    </section>
    <section id="section6">
      <title>See Also</title>
      <p>
        <xref href="./gpstop.xml#topic1" type="topic" format="dita"/>
      </p>
    </section>
  </body>
</topic>
